package negocio;

import java.io.File;
import java.util.ArrayList;

import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRExporterParameter;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.engine.export.JRPdfExporter;
import net.sf.jasperreports.engine.util.JRLoader;
import net.sf.jasperreports.engine.xml.JRXmlLoader;
import persistencia.AnaliticoDAO;


public class AnaliticoControlador {

	public static ArrayList<Analitico> getAnaliticoByAlumno(Alumno alumno)
	{
		return AnaliticoDAO.getInstance().getAnalitico(alumno);
	}
	
	

	  public static JasperPrint llenarReporteAnalitico(ArrayList<Analitico> data) throws JRException
	  {
		  JasperReport report=(JasperReport) JRLoader.loadObjectFromFile("reporteAnalitico.jasper");
		  
		  JasperPrint jp = JasperFillManager.fillReport(report, null, new JRBeanCollectionDataSource(data));
		    
		    return jp;
	  }


	  
	
}


